import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        num:1200,
        banners:[],
		headHeight:0,
        userInfo:null
    },
    actions:{
        changeNum({commit},payload){
            commit("changeNUmMutations",payload)
        },
        setbannersAction({commit},payload){
            commit("setBanners",payload)
        }
    },
    mutations:{
		changeHeight(state,payload){
			state.headHeight = payload;
		},
        changeNUmMutations(state,payload){
            state.num+= payload
        },
        setBanners(state,payload){
            state.banners = payload 
        },
        changeUserInfo(state,payload){
            state.userInfo = payload;
        }
    }
})